//
//  CreateJobInstallationVC.swift
//  GreenDeal
//
//  Created by Moennig Q on 2/3/2023.
//

import UIKit

class CreateJobInstallAddressVC: BaseViewController {
    var editFlag: Bool = false//创建和Review的编辑共用此功能
    let customView = CreateJobInstallAddressView(topBGImageName: "createjob_installation_address_top_bg")
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.initUI()
        self.setData()
    }
    //MARK: - 设置UI
    private func initUI(){
        self.view = self.customView
        self.customView.setTitleInfo(R.string.localizable.installationAddress())
    }
    //MARK: - 设置数据
    private func setData(){
        self.customView.setData(CreateJobModelHelper.shared.createJobViewModel.installationAddressViewModel)
    }
    func getData(){
        let addressModel = CreateJobModelHelper.shared.createJobViewModel.installationAddressViewModel.installAddress
        //不一致就重新赋值
        if addressModel.full_address != addressModel.final_full_address {
            addressModel.full_address = addressModel.final_full_address
            addressModel.address_id = ""
        }
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.navigationController?.setNavigationBarHidden(true, animated: false)
    }
}
